<html>
<head><meta charset="utf-8"><title>How to check linker used by cc · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20check.20linker.20used.20by.20cc.html">How to check linker used by cc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241292620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20check%20linker%20used%20by%20cc/near/241292620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kevin Tran <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20check.20linker.20used.20by.20cc.html#241292620">(Jun 02 2021 at 17:38)</a>:</h4>
<p>I've tried to place a directory in the PATH of cc to replace ld. How can I check that I'm actually replacing ld with my version of ld?</p>



<a name="241315203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20check%20linker%20used%20by%20cc/near/241315203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20check.20linker.20used.20by.20cc.html#241315203">(Jun 02 2021 at 20:28)</a>:</h4>
<p><span class="user-mention" data-user-id="351526">@Kevin Tran</span> You could try to use something like <code>echo 'fn main() {}' | RUSTC_LOG=debug rustc - --crate-type bin -Clink-arg=-v</code> to pass the -v arg to the linker. This will cause the linker to print out it's version and various other things.</p>



<a name="241315418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20check%20linker%20used%20by%20cc/near/241315418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20check.20linker.20used.20by.20cc.html#241315418">(Jun 02 2021 at 20:30)</a>:</h4>
<p>Or actually I think you should pass <code>-Wl,-v</code> instead of <code>-v</code> to show the version of ld instead of cc.</p>



<a name="241356807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20check%20linker%20used%20by%20cc/near/241356807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kevin Tran <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20check.20linker.20used.20by.20cc.html#241356807">(Jun 03 2021 at 07:32)</a>:</h4>
<p>How would I make a test that lld is being used instead of whatever cc normally uses? Even if lld is not used, compilation might still succeed. Should I test the output passing -v to the linker?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>